package com.ygxsk.carhome.enumwrap;

/**
 * 维保状态枚举
 *
 * @author syh
 * @createDate 2023/7/31 17:58
 */
public enum AppointmentStatus {
    /**
     * 未处理
     */
    nodo(0, "待处理"),
    /**
     * 已派单
     */
    sended(1, "已分配"),
    /**
     * 已接单
     */
    taked(2, "已接单"),
    /**
     * 处理中
     */
    doing(3, "已确认"),
    /**
     * 处理完
     */
    done(4, "已完成"),
    /**
     * 已取消
     */
    canceled(5, "已取消"),
    ;

    private final int code;
    private final String desc;

    AppointmentStatus(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    public int getCode() {
        return code;
    }

    public static String getStrDesc(int code) {
        for (AppointmentStatus status : AppointmentStatus.values()) {
            if (code == status.code) {
                return status.desc;
            }
        }
        return "";
    }
}
